package com.linpq.road.controller;

import com.linpq.common.core.controller.BaseController;
import com.linpq.road.domain.RdHighSpeedRoad;
import com.linpq.road.domain.RdManagementUnit;
import com.linpq.road.domain.RdRoadSection;
import com.linpq.road.service.RdHighSpeedRoadService;
import com.linpq.road.service.RdManagementUnitService;
import com.linpq.road.service.RdRoadSectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author Longos
 * @date 7/30/2021 4:50 PM
 */

@Controller
@RequestMapping("/road/data")
public class RoadDateController extends BaseController {
private  String prefix="road/data";
    @Autowired
    private RdRoadSectionService rdRoadSectionService;
    @Autowired
    private RdHighSpeedRoadService rdHighSpeedRoadService;
    @Autowired
    private RdManagementUnitService rdManagementUnitService;


    @GetMapping()
    public String data(ModelMap mmap){
        List<RdHighSpeedRoad> highSpeedRoadList=rdHighSpeedRoadService.findList(new RdHighSpeedRoad());
        List<RdManagementUnit> rdManagementUnitList=rdManagementUnitService.findList(new RdManagementUnit());
        List<RdRoadSection> rdRoadSectionList=rdRoadSectionService.findList(new RdRoadSection());
        mmap.put("highSpeedRoadList",highSpeedRoadList);
        mmap.put("rdManagementUnitList",rdManagementUnitList);
        mmap.put("rdRoadSectionList",rdRoadSectionList);
        return prefix +"/data";
    }

}
